package template;

import java.sql.SQLException;

import net.databinder.auth.ao.AuthDataApplication;
import net.databinder.auth.data.DataUser;
import net.java.ao.DatabaseProvider;
import net.java.ao.EntityManager;

public class Auth extends AuthDataApplication {

	@Override
	public Class getHomePage() {
		return Index.class;
	}
	
	@Override
	protected DatabaseProvider buildDatabaseProvider(Object key) {
		return DatabaseProvider.getInstance(
				"jdbc:hsqldb:mem:basic-ao", null, null);
	}
	@SuppressWarnings("unchecked")
	@Override
	protected void generateSchema(EntityManager entityManager, Object key) throws SQLException {
		entityManager.migrate(Datum.class, Person.class, Calendar.class, Event.class, EventsToCalendars.class);
	}
	
	@Override
	public Class<? extends DataUser> getUserClass() {
		return Person.class;
	}
	
	public byte[] getSalt() {
		return "CALENDACTYLA9819F01A31F393E25E4668764F07CBB587E388BB8100CDFD788BB1C336D4F6D".getBytes();
	}
}
